home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 18059 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  982 b 

  1. Path: mail2news.demon.co.uk!j-bg.demon.co.uk
  2. From: John Sargent <jb@j-bg.demon.co.uk>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Array pointer?
  5. Date: Thu, 18 Apr 96 18:06:11 GMT
  6. Message-ID: <829850771snz@j-bg.demon.co.uk>
  7. References: <DppIHL.MzF@on.bell.ca> <829513366snz@j-bg.demon.co.uk> <4l4f73$1a8_004@donstarr.best.com>
  8. Reply-To: jb@j-bg.demon.co.uk
  9. X-NNTP-Posting-Host: j-bg.demon.co.uk
  10. X-Newsreader: Demon Internet Simple News v1.29
  11. X-Mail2News-Path: j-bg.demon.co.uk
  12.  
  13. In article <4l4f73$1a8_004@donstarr.best.com>
  14.            super@donstarr.org "Don Starr" writes:
  15.  
  16. > *
  17. > * [OK stuff clipped]
  18. > *
  19. > *>         ; is this correct, too?
  20. > *>         int *c3
  21. > *>         
  22. > *>         c3 = (a + 3 * sizeof(int) );
  23. > *>         count << *c3;
  24. > *> 
  25. > *
  26. > *          OK. you'll get the contents of a[3]  
  27. > No, you'll get the contents of a[ 3 * sizeof(int) ]. The compiler will handle 
  28. > the sizeof when it does the pointer arithmetic.
  29.  
  30.  
  31. Oops. You're right.
  32.  
  33.  
  34. Regards,
  35. John Sargent
  36.